<?php

include('util.php');

function _upfile_oss($oss,$bucket,$key,$value){
    if(!$value) return "";
    if(!$key){
        $key = create_uuid('**').".jpg";
    }
    $oss->putObject(array(
        'Bucket' => $bucket,
        'Key' => $key,
        'Content' => $value,
        'ContentLength' => strlen($value),
    ));
    return "http://{$bucket}.oss-cn-qingdao.aliyuncs.com/{$key}";
}
?>